This script saves the selection in a text file.